package com.jn.okhttps_demo02.service;




import com.jn.okhttps_demo02.response.DictResponse;
import com.jn.okhttps_demo02.response.HotSearchResponse;
import com.jn.okhttps_demo02.response.TranslationRequest;
import com.jn.okhttps_demo02.response.TranslationResponse;

import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.Body;

public interface ApiService {
    @Headers({
            "Accept: application/json",
            "Content-Type: application/json"
    })
    @GET("api/common/fetchHotSearchBoard")
    Call<HotSearchResponse> getHotSearch(@Query("type") String type);

    @Headers({
            "Accept: application/json",
            "Content-Type: application/json"
    })
    @GET("api/txt/dict")
    Call<DictResponse> getDict();

    @Headers({
            "Accept: application/json",
            "Content-Type: application/json"
    })
    @POST("api/txt/QQFanyi")
    Call<TranslationResponse> postTranslation(@Body TranslationRequest request);
}